Repository navigation
feat(i18n): a dependent package's fieldPatches text is translated from that package's own translations - #34784
Conversation
…'s own translations on /meta A field slot a code package's fieldPatches wrote read only the .custom pair's catalog, so a dependent's patched label, help text and option label were served as written in every locale. The registry now answers which code package wrote which patched text, the protocol answers that package's own translations, and the object translator reads them below the pair's. Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
…dPatches text Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
…ntyped view Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
…rough the predicate; ledger learns two pinned doubles Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
…ge-translation-bundle pin Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
…into claude/project-thread-jkfy43
📓 Docs Drift CheckThis PR changes 4 package(s): 8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 86be806cccc0d527dba007c2e3cae21c02698aa5 && git checkout 86be806cccc0d527dba007c2e3cae21c02698aa5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 189358f212fdd3da6cf5db5f53d00927520a6406 c9c9a9a5b488144d246eae82d729300b474dbab6 && git checkout -B drift-repro 189358f212fdd3da6cf5db5f53d00927520a6406 && git merge --no-ff c9c9a9a5b488144d246eae82d729300b474dbab6
node scripts/docs-audit/affected-docs.mjs --json 189358f212fdd3da6cf5db5f53d00927520a6406
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRfW5u1LRmhWwaYHRp Final head for review: |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 26d09ed · 2026-11-17T10:55Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmTPcB6fZEwhd2hNQwC 席位核对L1 verdict: ACCEPT · PR #34784 · card #33952 (ruling B, 6942920667) · first review · L1-c2 of seat repo:objectstack#2 Head-sha: Read from GitHub and the diff at this head, not from the report. 16 files, +1007/−15. Shape
Code, against the ruled order (pair
Pins: 8 spec cases, 4 objectql, 5 metadata-protocol, +5 rest
Deviations, none blocking
Gates: 72 check-runs on this head, all L2 owed: yes. The PR has Landing tier: NOT governed by the register (0 of 16 paths), +1007/−15 = 1022 lines ≤ 3000. Because it touches |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract reviewServed-tier: Inputs read: card #33952 body and all four comments (seat analysis 6931518666, ruling 6942920667 = B, claim 6943444488, dev report 6945274012); PR #34784 body, file list (16 files) and the net diff against merge-base f02f4f6; the 72 check-runs on the head. Everything below marked "read from code" was read in git objects at the head and was not executed. Check-runs on the head: all 72 completed, none pending. No failure. Success on every build, test, type-check and lint family (Test Core 1 to 8 of 8, Test UI 1 to 16 of 16, Build Core, TypeScript Type Check, the Lint and Type Check gate families, Check Changeset, Governed Surface Queue Guard, Spec property liveness, PR-body guards, Lint · PM dispatch-gates, Dogfood Regression Gate, Live E2E UI). Skipped, so no verdict from them: Queue verdict, Borrowed queue verdict, Packed-tarball smoke (opt-in), 18.x upgrade harness (opt-in), Temporal Conformance, UI Published Artifacts, Dogfood Verify CLI, the Dogfood Regression Gate shard matrix row, Lint UI, the schedule gate, and the second Auto Label and Check PR Size runs. ① Derived judgments
② Semver levelClause-②: yes (widening) The changeset bumps
③ Boundary flags
Security-touching: yes ④ Design judgment
The jsdoc on M1 (must-fix) — the read now translates a slot that the write door's inverse cannot put back, so a non-source-locale Studio save can store the patching package's translation as the document. Read from code, not executed. N1 (nit) — N2 (nit) — the N3 (nit) — Implemented-by: VERDICT: FAIL |
…ead's patch bundles Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
…rse and the slots a patch bundle reaches Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
…into claude/project-thread-jkfy43
…ir facet bodies Claude-Session: https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmRfW5u1LRmhWwaYHRp Final head for review delta: |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 70347ee · 2026-11-17T12:27Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmTPcB6fZEwhd2hNQwC 席位核对L1 verdict: ACCEPT (delta) · PR #34784 · card #33952 · delta over Head-sha: The delta is read commit by commit, from M1: the save door's inverse (
Pins for M1
D1–D3 (
Gates: 74 check-runs on this head, all L2 owed: yes, the delta against FAIL 6946177705. The PR has Landing tier: NOT governed by the register. Because of the |
…hanged and the stored row leaves to it The write door's inverse asked a patching package's base for a slot even when the stored row carried text of its own there, so a tenant's stored label equal to that package's translation was rewritten to the patch text on any whole-body save. A patch entry is now asked for a slot only where its patch changed that slot against the packaged base, and only where the stored row does not declare the slot or carries the packaged text there. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
…row that does not declare the field Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
…-jkfy43 # Conflicts: # packages/metadata-protocol/src/protocol-discovery-and-bases.ts
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review · REWORK, paper only · Head-sha: This reviews the delta from L1 6948050882 (delta ACCEPT at
The code closes both findings. One gate is red on paper. Must-fixM1.
Either way, the guard must be green on the final head. A delta ACCEPT on this same head follows if only the body or card moves. Closed
Checklist (the rest holds)
Owed, for the seat: a contract-review delta at CONTRACT_REVIEW_TIER for |
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review (same head) · ACCEPT · Head-sha: This reviews the delta from L1 6950376285 (REWORK, paper only) on this same head. The code did not move. Only the PR body changed.
Owed: the seat's contract-review delta at CONTRACT_REVIEW_TIER for |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Delta review. The latest at-tier record before this one is PR comment 6948153780 (PASS on head The delta in bytes:
Check-runs on the head, latest attempt per name: all ① Derived judgments
② Semver levelClause-②: yes (widening) Unchanged: minor on ③ Boundary flags
Security-touching: yes ④ Design judgmentNotation as in 6948153780: packaged text
N4. A patch of The pins. Pure layer, S1: closed S2 (should-fix) — the stored guard is a second copy of the fold's comparison and differs from it on the empty string, so on that edge the door stores the translation as the source text again. The guard reads Not graded, for the record: the door e2e pin builds the read from the stored row itself and not from the registry's fold, as its two older siblings do, so it pins the door against the translator, not against the fold's yield. The same limit was recorded in 6948153780. On Implemented-by: VERDICT: PASS |
…he fold's own predicate The stored half of the per-slot patch guard in restoreTranslatedEchoes was a second copy of the fold's comparison and differed on the empty string: with a stored label '' on a patched slot the fold applies the patch (the read serves Tax ID, zh-CN 税号), but the guard skipped the patch entry, so a zh-CN whole-body save stored 税号 as the tenant's text for every locale. The guard now asks scalarOverridesPackagedBase over the packaged field, option or object that holds the slot, the same call the fold makes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Delta review. The latest at-tier record before this one is PR comment 6950554757 (PASS on head The delta in bytes: one commit, Check-runs on the head, read at 2026-11-17T15:50Z: 69 runs, 59 ① Derived judgments
② Semver levelClause-②: yes (widening) Unchanged: minor on ③ Boundary flags
Security-touching: yes ④ Design judgmentNotation as before: packaged text
Walks, each read from code:
The pin. S2: closed No must-fix, no should-fix. Nits:
Not graded, for the record: the new pin builds the body from a hand-written folded row, not from the registry's fold over a stored On #34836: S1, N4 and S2 are closed at this head. Under the merge standard given for this PR nothing blocking is open; only N1 and N2 remain. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review · ACCEPT · Head-sha: This reviews the delta from L1 6950446636 (same-head ACCEPT at
No new findings. The seat's contract-review delta PASS at this head is noted. This comment readies, queues and arms nothing. Still owed after the merge: the area's manual close of #34836. |
…ing #34784) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
The main merge left protocol.ts at 11706 lines, one over the ceiling of 11705 (ruling 6897467376). Drop the blank line between the two new delegations. No behaviour change. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review (main merge + line-ceiling trim) · ACCEPT; landing waits on gates · Head-sha: This reviews the delta from L1 6953216101 (delta ACCEPT at
There is nothing new to review. The earlier Gates at this head: CI was still running when this was read. This ACCEPT does not stand in for green. The seat's contract-review PASS at |
|
repo:objectstack#3 · os-support-ai · session_01WGufzfr1xZSFZzCR8HnqXX Landing · PR #34784 (card #33952,
|
Requested by Yibo Wang · project thread
Fixes #33952
Also answers finding #34836 (S1 and N4, both pinned here). That card holds no claim on this branch, so the area shuts it by hand after the merge.
Clause-②: yes (widening) —
TranslateDocumentOptionsgains an exported member,patchBundles; nothing accepted before is refusedMetadata-protocol: semantic — a dependent package's translations of its own
fieldPatchestext now take effect on/metaand on the public form; on a patched slot the pair.customtranslation is laid over the package's locale by locale, so a pair that translates the slot only in a fallback locale (en) no longer wins over the package's translation in the requested one (zh-CN)Skills-docs: follow-up #34785
维护者速读
fieldPatches改写厂商对象字段的标签、说明、选项名后,这些文字现在按该依赖包自己的翻译显示(先.custom配对包的翻译,再依赖包的,最后原文)。packages/spec/src/system/i18n-resolver.ts(partCatalog选目录的顺序)、packages/objectql/src/registry-platform-global.ts(getPackagedFieldPatchBases哪个包写了哪段文字)、packages/metadata-protocol/src/protocol-discovery-and-bases.ts(getPackageTranslationBundle读单个包的翻译)。pnpm --filter @objectstack/rest exec vitest run src/meta-object-field-patch-i18n.test.ts,预期全过,其中 [i18n: let a dependent package's fieldPatches label/description be translated from that package's own catalog (split from #33800 half 2) #33952] 一组断言补丁标签在 zh-CN 下读到「税号」。packages/spec/src走 Tier H 由席位交棒,治理面读数 NOT governed;审核记录在案前不求批。What changes
A code package that relabels a vendor's field with
fieldPatches(ADR-0146 D10) now has that text translated from its own translations. Before, a patched label, help text, description or option label was served as the patch wrote it in every locale: a patched slot read only the pair.customcatalog, and the deployment catalog deep-merges every package's translations with the package ids dropped (FileI18nAdapter.loadTranslations), so the patching package's rows never reached the slot. Re-measured onorigin/maindc66d33 before writing any code: the/metaitem read served{"label":"Tax ID","description":"Unified social credit code."}under zh-CN with the dependent's zh-CN rows for both keys in the catalog.Order on a patched slot, as ruled (6942920667, answering 6931518666):
.custompackage's translation of the key;translations, then its own activetranslationrows);The owner's translation never applies to a patched slot (#29564 stays fixed). A slot no patch wrote (a tenant's rename on top) keeps its own text. Nothing is stamped on the served document: the writing package is found by comparison, the served value against the packaged base with that one package's patches applied (ADR-0029 D9.2a).
@objectstack/spec—TranslateDocumentOptions.patchBundles(the name the seat analysis proposed);translateObjectreads it on a changed field slot: label, help/description, option label, and through the sameslotCatalogalsoinlineTitleandrelatedListTitle. The pair is laid over each package's bundle locale by locale along the fallback chain (the interleaving ruling 6631250894 fixed for unchanged strings), so a pair that translates a patched slot only inenno longer wins over the package'szh-CN.@objectstack/objectql—SchemaRegistry.getPackagedFieldPatchBases(name): one entry per enabled code package whose extension patches the object, highest precedence first, each the packaged base with only that package'sfieldPatchesapplied.getPackagedObjectBaseis unchanged and still never folds a patch in.@objectstack/metadata-protocol—getPackagedFieldPatchBases(name)(the registry read, feature-detected) andgetPackageTranslationBundle(packageId)(one package's translations, locale-keyed: its installed record'stranslations, then its own active rows bound bypackage_id).@objectstack/rest— the/metaobject item and list reads andGET /forms/:slugpasspatchBundles(memoised per package across a list page). The public form passes nopairBundle(onmaintoo), so there a patched slot reads package, then text.restoreTranslatedEchoes, viarestoreTranslatedObjectEchoes; L2 M1 on the first head): it now translates its sources with the read'spatchBundles(read through two newProtocolHostmembers), and each entry's patched base, cut to the fields its patch changed, is a source of its own between the stored row and the platform columns. So a zh-CN Studio GET then whole-body PUT of a patched label stores the patch text (Tax ID), not the package's translation (税号), over a stored row carrying the patch text and with no stored row; before the fix both stored税号, which every locale then served.Five packages became four. The card expected a per-package translation copy kept by
II18nServiceand the runtime. Read from code, neither is needed:registerApp→installPackage(manifest)keeps the converted manifest,translationsincluded, on the package record (getPackage(id).manifest), so the protocol reads a package's own bundle from the registry.II18nServiceandpackages/runtimeare not touched. That read is pinned byregistry-field-patch-bases.test.ts(a realObjectQL.registerApp, thengetPackageTranslationBundleover it).Tests
New:
packages/spec/src/system/i18n-resolver.object-patch-bundles.test.ts(8): patched label/help/option read the patching package's zh-CN; nopatchBundleskeeps the text; an untranslated locale keeps the patch text; a tenant rename keeps its text; two patching packages; the pair keeps the first rank; an entry with no base / nopackagedBase;translateMetadataDocumentpassthrough.packages/objectql/src/registry-field-patch-bases.test.ts(4).packages/metadata-protocol/src/protocol.package-translation-bundle.test.ts(5).Extended (new
describeblocks only, no existing assertion changed):packages/rest/src/meta-object-field-patch-i18n.test.ts(+5).packages/rest/src/public-form-section-i18n.test.ts(+2).packages/objectql/src/protocol-meta-effective-schema.test.ts(+2): the zh-CN GET → PUT round trip on a patched label, with and without a stored row carrying the patch text; asserts the stored text isTax IDand anenread serves it. Red on the first head26d09ed6before the fix: 2 failed,expected '税号' to be 'Tax ID'on the stored label.packages/metadata-protocol/src/protocol-translated-echo.test.ts(+3): the pure inverse withpatchBundles(both sources), a tenant rename on an unpatched field kept, and nopatchBundles⇒ no restore.Ablations (each restored, blob == HEAD):
index < patchCatalogs.length→index < 0) →i18n-resolver.object-patch-bundles.test.ts5 failed | 3 passed (the three green are the keep-own-text cases).patchTranslationBundlesOfmade to returnundefined→ 4 failed | 33 passed across the two rest files (exactly the four [i18n: let a dependent package's fieldPatches label/description be translated from that package's own catalog (split from #33800 half 2) #33952] serving cases).restoreTranslatedObjectEchoespasses nopatchBundles→ round trip 2 failed (both legs).[storedDoc, injectedDoc]) → round trip 1 failed (no-row leg) | 1 passed (stored-row leg).protocol-translated-echo.test.ts1 failed (the tenant-rename case) | 9 passed.Acceptance notes
label/descriptionan extension sets throughobjectExtensions(notfieldPatches) may have the same gap; not measured.translateObjectcallers (validation messages, formulalabel()and the like) still pass nopatchBundles, so they serve a patched slot as before. The/i18n/translationsdetail read was not re-measured./metaconditional read can still answer 304 after a translation-only change of a patch bundle, since the validator hashes the served document and locale and no catalog (same standing as the deployment catalog and pair bundle today).patchTranslationBundlesOfand the door issue onesys_metadataread per patching package (filtered in SQL, memoised per list page), where the pair read folds bindings into one$in.packages/rest/src/form-routes.ts+public-form-section-i18n.test.ts(the public form translates the same object) one paragraph incontent/docs/data-modeling/object-extensions.mdx, the two ledger rowscheck:engine-double-contract --writeadded toscripts/engine-double-contract.pinned.json, and for M1protocol-translated-echo.ts,protocol-host.tsand the host install inprotocol.ts.8510e0e9: the door's inverse asked a patch entry for a slot even where the stored row declared that slot with its own text, so a stored税号equal to the patching package's zh-CN translation was rewritten toTax IDon any whole-body save. Route: the first one metadata-protocol: the write door's patch-source echo rewrites a tenant's stored label that equals the patching package's translation, and cuts the patch source by field instead of by slot #34836 names. A patch entry now answers a slot only where its patch changed that slot against the packaged base (per slot, not per field: N4), and only where the stored row does not declare the slot or carries the packaged text there (S1). The two pinned legs hold unchanged (a storedTax ID; no row, so the packaged base is the source). Pins:protocol-meta-effective-schema.test.ts+1 (stored税号, anenwhole-body save with an unrelated edit toname, through the realsaveMetaItem: the stored label stays税号and the edit lands);protocol-translated-echo.test.ts+3 (the same at the pure layer; N4's catalog string typed over a tenant-renamed slot is kept; a slot the patch left alone is no patch source where the stored row does not declare the field). Ablations throughscripts/ablation-replace.mjs, each restored with blob == HEAD: the S1 guard removed, metadata-protocol rebuilt, dist preflight--absentexit 0, gives pure 1 failed / 12 passed and door 1 failed / 24 passed, bothexpected 'Tax ID' to be '税号'; restored, rebuilt and preflight present gives 13/13 and 25/25. The per-slot cut removed gives pure 1 failed / 12 passed (expected 'Registration number' to be '注册号说明', the slot-cut pin). The changeset and thepatchBundlesdocblock are unchanged: their wording still matches.origin/mainmerged (one import-line conflict inprotocol-discovery-and-bases.ts, resolved as the union of both). Local on8510e0e9: metadata-protocol 349 passed / 9 skipped, typecheck green; objectql typecheck green,protocol-meta-effective-schema.test.ts+registry-field-patch-bases.test.ts29/29; rest patch files 37/37; the 52 gate families derived for this round's three paths all exit 0 (check:dual-build-cjs-loadsandcheck:type-check-debtfirst read NOT MEASURED for want of build state and the lock, then re-run green).70e332e8: the stored half of the patch guard inrestoreTranslatedEchoeswas a second copy of the fold's comparison and differed on an empty string, so a storedlabel: ''on a patched slot let a zh-CN whole-body save store税号as the tenant's text. It now asksscalarOverridesPackagedBase(imported from@objectstack/spec/system) over the packaged field, option or object that holds the slot, the same call the fold makes. Pin:protocol-translated-echo.test.ts+1 (stored'', the zh-CN echo of the fold'sTax ID, restored toTax ID). Ablation throughscripts/ablation-replace.mjs(guard put back to the old copy; pure suite importssrc, no build): 1 failed / 13 passed,expected '税号' to be 'Tax ID'; restored blob == HEAD196e74e7, 14/14 green. Local on70e332e8: metadata-protocol 349 passed / 9 skipped (23103 tests), typecheck green; objectql door pins 29/29; rest patch files 37/37; 51 gate families derived for this round's two paths, 50 exit 0,check:dual-build-cjs-loadsNOT MEASURED (exit 3, no full-repodist/; CI runs it).Verification
All on head
70347ee4(the M1 rework withorigin/mainmerged), on a shared box:pnpm --filter … run test, under the verify lock), on74ab926d(the merge, before the docblock-only commit): spec 849 files / 27178 tests passed; metadata-protocol 349 passed, 9 skipped; objectql 607 / 13612 passed; rest 415 passed;run typecheck(incl.check:test-typecheck) green for all four. metadata-protocol re-run on70347ee4after moving two docblocks: 349 passed, 9 skipped; typecheck green.node scripts/pm/dispatch-gates.mjs --commands: 129 derived families, allexit 0on70347ee4;--ranreconciles 129 run, 0 NOT-MEASURED. The round before it foundcheck:facade-delegation-onlyred (protocol.ts12 lines over its ceiling oncemainwas merged); fixed by moving the two new reads' docblocks to their facet bodies, leaving one-line pointers.26d09ed6: 129/129 gates, the same four suites green, CI 72 check-runs green. Two real reds of an earlier round fixed there:check:engine-double-contractandcheck:test-source-alias.origin/maindc66d33: patched zh-CN read servedTax ID/Unified social credit code.; with this branch the same read serves the dependent's税号(pinned inmeta-object-field-patch-i18n.test.ts).🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmP5nzKTLbaqcH74Nos